<?php namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Categories extends BaseModel {

	protected $table = 'categories';

	public $timestamps = false;

	protected $fillable = [
		'cat_name',
		'sort_id',
		'parent_id',
		'status'
	];


	public function scopeStatus($query){

		return $query->where('status',self::NORMAL_STATUS);

	}

	/**
	 * 获取分类列表
	 */
	function get_categories_list(){
		return $this
				->status()
				->paginate(self::PAGESIZE);
	}

}
